package chapter09

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/10 22:24
  * @history:
  *          1.2019/1/10 created by chuhaitao
  */
object MixinDemo {
  def main(args: Array[String]): Unit = {
    //使用动态混入
    var oracle = new Oracle with Option3
    //抽象类中有抽象方法的动态混入
    var mysql = new Mysql with Option3 {
      override def delete(id: Int): Unit = {

      }
    }
    oracle.insert(1)
    mysql.insert(1)
  }
}


trait Option3 {

  def insert(id: Int): Unit = {
    print("---")
  }
}

class Oracle() {

}

abstract class Mysql() {

  def delete(id: Int)
}